BaselineSet loop problem

Good afternoon!
I wanted a second opinion, a help to see a solution to my problem.

The problem is as it follows:
My dxl, the attached file, is a GUI with several functions, one of these functions is to add modules on a BaselineSet, created by the same GUI or not.
The thing is that if I create more than one BaselineSet, when I use the button "Add Modules" , every BaselineSet from the project receive the selected modules.
I wanted that only the latest BaselineSet received the added modules.
Or at least, that only the BaselineSet I choose receive the modules.

The thing is that I can't think of a way to call a specific BaselineSet, or just the latest BaselineSet, so it can receive the modules.

If anyone can help, thank you.

This forum helped me a lot in creating this script ...

The problem, is between lines 131 and 175

Thank you!
Bruwbruw - Fri Nov 30 08:08:50 EST 2012

Re: BaselineSet loop problem
llandale - Fri Nov 30 13:35:26 EST 2012

Not following the code well. But...

At line 151
  • for BSD in current Folder do
you loop through all the Baseline sets. I would guess you want to compare the name of this BSD with the value you get from dbe selectModulesDB; and "continue" if they do not match. Perhaps:
  • string NameDesired = get(selectModulesDB)
  • for BSD in current Folder do
  • { if (name(BSD) != NameDesired) continue

-Louie

I'm pretty sure you will want to do this at the top:
  • Folder fHome = current
and then use "fHome" instead of all those "Folder f = current" statements. If the current module changes (when you open one) so will the current folder.